/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.senai.view;

import javax.swing.Action;
import javax.swing.JCheckBox;

/**
 *
 * @author Simulado
 */
public final class CheckBox extends JCheckBox {

    public CheckBox() {
    }

    public CheckBox(Action a) {
        super(a);
    }

    public CheckBox(String text, boolean selected) {
        super(text, selected);
    }

    public void alterarComboBox(Action a, String text, boolean selected) {
        if(a!=null){
        this.setAction(a);
        }
        setModel(new ToggleButtonModel());
        model.setSelected(selected);
        if (text != null) {
            setText(text);
        }
        setName(text);
        // Set the UI
        updateUI();

        setAlignmentX(LEFT_ALIGNMENT);
        setAlignmentY(CENTER_ALIGNMENT);

    }

    public CheckBox(Action a, String text, boolean selected) {
        alterarComboBox(a, text, selected);
    }

}
